<template>
    <el-card class="box-card" shadow="hover" :body-style="{ padding: '20px' }">
      <div class="article-header">
<!--        查看文章-->
        <a @click="view(id)" class="article-title">{{title}}</a>
        <span class="pull-right article-count">
          <i class="el-icon-chat-line-round"/>{{commentCount}}
        </span>
        <span class="pull-right article-count">
          <i class="el-icon-view"/>&nbsp;{{views}}
        </span>
      </div>
      <div class="artile-description">{{summary}}</div>
      <div class="article-footer">
        <el-tag style="background-color: #e5efff;border-color: #ffffff;color: #0066ff;">
          {{categoryId}}</el-tag>
        <span class="pull-right article-count Cbottom">
            <i class="el-icon-time"/>{{createTime}}
        </span>
      </div>
    </el-card>
</template>

<script>
export default {
  name: "articleItem",
  props: {
    id: String,
    authorId: String,
    title: String,
    categoryId:String,
    summary: String,
    commentCount: String,
    views: Number,
    articleTag: String,
    createTime: String,
    updateTime: String
  },
  methods:{
    view(id){
      this.$router.push({path:`/article/view/${id}`})
    }
  }
}
</script>

<style scoped>

  .artile-description {
    font-size: 15px;
    font-weight:520;
    line-height: 25px;
    margin-bottom: 30px;
    margin-top: 5px;
  }
  .article-header {
    padding-bottom: 10px;
  }
  .article-footer {
    /*margin-bottom: 10px;*/
  }
  .pull-right {
    float: right;
  }

  .article-title {
    font-weight: bold;
    font-size: 20px;
  }
  .article-count {
    color: #8690a6;
    padding-left: 14px;
    font-size: 15px;
  }
  /*底部创建时间*/
  .Cbottom {
    padding-top: 16px;
  }
  /*文章卡片大小调整*/
  .box-card {
    /*height: 200px;高度自适应改变*/
    width: 820px;
    border-radius: 5px;

  }
  /*文章卡片整体调整*/
  .el-card{
    margin-bottom:20px;
    margin-left:170px;
  }

  /*标签的字体色彩*/
  .el-tag.el-tag--success {
    background-color: #e5efff;
    border-color: #ffffff;
    color: #0066ff;
  }
  .el-button{
    background-color: #e5efff;
    border-color: #ffffff;
    color: #0066ff;
  }
</style>
